﻿<UserControl x:Class="TestCaseManagerApp.Views.TestCasesMigrationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:local="clr-namespace:AAngelov.Utilities.UI.ControlExtensions;assembly=AAngelov.Utilities.UI"
             mc:Ignorable="d" Loaded="UserControl_Loaded">
    <Grid>
        <ProgressBar Name="progressBar" Minimum="0" Maximum="1" Height="16" IsIndeterminate="True" Margin="0,0,0,16" />

        <Grid Name="mainGrid" Visibility="Visible">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*" />
                <RowDefinition Height="3*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.6*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="0.4*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal">
                <Label Content="Migrate Test Cases" FontWeight="Bold" FontSize="26" Margin="10" Grid.Row="0" Height="Auto"/>
                <mui:ModernButton Name="btnInfo" HorizontalAlignment="Left" Grid.Row="0" Margin="10,20,10,15" Click="btnInfo_Click" IconData="F1 M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z "/>
            </StackPanel>
            <StackPanel Orientation="Vertical" Grid.Column="0" Grid.Row="1">
                <Label Content="Source Team Foundation Server Project" FontWeight="Bold" FontSize="12" Margin="15"/>
                <Label Content="Source Test Plan" FontWeight="Bold" FontSize="12" Margin="15"/>
                <Label Content="Destination Team Foundation Server Project" FontWeight="Bold" FontSize="12" Margin="15"/>
                <Label Content="Destination Test Plan" FontWeight="Bold" FontSize="12" Margin="15"/>
            </StackPanel>
            <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1">
                <TextBox Margin="10" Name="tbTfsProjectSource" Height="30" Text="{Binding SourceFullTeamProjectName}"/>
                <ComboBox Margin="10" Height="30" ItemsSource="{Binding ObservableSourceTestPlans}" Name="cbTestPlansSource" local:ComboBoxDropdownExtensions.OpenDropDownAutomatically="True" MouseMove="cbTestPlansSource_MouseMove"  SelectedIndex="0" SelectionChanged="cbTestPlansSource_SelectionChanged"/>
                <TextBox Margin="10" Name="tbTfsProjectDestination" Height="30" Text="{Binding DestinationFullTeamProjectName}"/>
                <ComboBox Margin="10" Height="30" ItemsSource="{Binding ObservableDestinationTestPlans}" Name="cbTestPlansDestination" local:ComboBoxDropdownExtensions.OpenDropDownAutomatically="True" MouseMove="cbTestPlansDestination_MouseMove"  SelectedIndex="0" SelectionChanged="cbTestPlansDestination_SelectionChanged"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal"  Grid.Row="2"  Grid.Column="0" Grid.ColumnSpan="3" Height="Auto">
                <DataGrid Name="dgTextsToBeReplaced" ItemsSource="{Binding ObservableSuitesToBeSkipped}"  CanUserAddRows="True" AutoGenerateColumns="False" Width="400" HorizontalAlignment="Left" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Test Suites To Be Skipped" Binding="{Binding NewText}" Width="*">
                            <DataGridTextColumn.HeaderStyle>
                                <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
                                </Style>
                            </DataGridTextColumn.HeaderStyle>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
            <StackPanel Orientation="Vertical" Grid.Row="2"  Grid.Column="1" Grid.ColumnSpan="3" >
                <ProgressBar Name="internalProgressBar" Minimum="0" Maximum="1" Height="16" IsIndeterminate="True" Margin="10" Visibility="Hidden" />
                <StackPanel Orientation="Horizontal" >
                    <Label Content="Current Progress: " FontWeight="Bold" FontSize="14" Margin="10,30,10,10"/>
                    <Label Name="lblProgress" FontSize="14" Margin="10" />
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Vertical" Grid.Column="2"  Grid.Row="1">
                <Button Name="btnSourceBrowser" Content="Browse" Margin="10" Width="150" Height="30" Click="btnSourceBrowser_Click" />
                <Button Name="btnDestinationBrowser" Content="Browse" Margin="10,50,10,10" Width="150" Height="30" Click="btnDestinationBrowser_Click" />
            </StackPanel>
            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Grid.Row="3"  Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Margin="0,0,0,50">
                <Grid Name="migrationGrid" Visibility="Visible" Grid.Row="3"  Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="0,0,0,50">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <!--Default Jsons Paths Browse-->
                    <StackPanel Orientation="Horizontal" Grid.Row="0"  Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Right">
                        <Label Content="Default Jsons Folder" FontWeight="Bold" FontSize="12" Margin="25" Height="30"/>
                        <TextBox Margin="25"  Name="tbDefaultJsonsPath" Width="500" Height="30" Text="{Binding DefaultJsonFolder}"/>
                        <Button Name="btnDefaultJsonsPath" Content="Browse" Margin="25" Width="150" Height="30" Click="btnDefaultJsonsPath_Click" />
                    </StackPanel>
                    <!--Migration Shared Steps Controls-->
                    <Button Content="Migrate Shared Steps" Name="btnMigrateSharedSteps" Margin="25" Width="180" Height="30" Click="btnMigrateSharedSteps_Click" Grid.Row="1"  Grid.Column="0"/>
                    <Button Content="Stop" Name="btnStopSharedStepsMigration" Margin="25" Width="Auto" Height="30" Click="btnStopSharedStepsMigration_Click" Grid.Row="1"  Grid.Column="1" IsEnabled="True"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="1"  Grid.Column="2">
                        <Label Content="Retry Json Path" FontWeight="Bold" FontSize="12" Margin="25" Height="30"/>
                        <TextBox Margin="25"  Name="tbSharedStepsJsonPath" Height="30" Width="500"  Text="{Binding MigrationSharedStepsRetryJsonPath}"/>
                        <Button Name="btnBrowserSharedStepsJsonPath" Content="Browse" Margin="25" Width="150" Height="30" Click="btnBrowserSharedStepsJsonPath_Click" />
                    </StackPanel>
                    <!--Migration Suite Controls-->
                    <Button Content="Migrate Suites" Name="btnMigrateSuites" Margin="25" Width="180" Height="30" Click="btnMigrateSuites_Click" Grid.Row="2"  Grid.Column="0"/>
                    <Button Content="Stop" Name="btnStopSuitesMigration" Margin="25" Width="Auto" Height="30" Click="btnStopSuitesMigration_Click" Grid.Row="2"  Grid.Column="1" />
                    <StackPanel Orientation="Horizontal" Grid.Row="2"  Grid.Column="2">
                        <Label Content="Retry Json Path" FontWeight="Bold" FontSize="12" Margin="25" Height="30"/>
                        <TextBox Margin="25"  Name="tbSuitesJsonPath" Height="30" Width="500" Text="{Binding MigrationSuitesRetryJsonPath}"/>
                        <Button Name="btnBrowseSuitesJsonPath" Content="Browse" Margin="25" Width="150" Height="30" Click="btnBrowseSuitesJsonPath_Click" />
                    </StackPanel>
                    <!--Migration Test Cases Controls-->
                    <Button Content="Migrate Test Cases" Name="btnMigrateTestCases" Margin="25" Width="180" Height="30" Click="btnMigrateTestCases_Click" Grid.Row="3"  Grid.Column="0" IsEnabled="True"/>
                    <Button Content="Stop" Name="btnStopTestCasesMigration" Margin="25" Width="Auto" Height="30" Click="btnStopTestCasesMigration_Click" Grid.Row="3"  Grid.Column="1" IsEnabled="True"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="3"  Grid.Column="2">
                        <Label Content="Retry Json Path" FontWeight="Bold" FontSize="12" Margin="25" Height="30"/>
                        <TextBox Margin="25"  Name="tbTestCasesJsonPath" Height="30" Width="500" Text="{Binding MigrationTestCasesRetryJsonPath}"/>
                        <Button Name="btnBrowseTestCasesJsonPath" Content="Browse" Margin="25" Width="150" Height="30" Click="btnBrowseTestCasesJsonPath_Click" />
                    </StackPanel>
                    <!--Migration Add Test Cases To Suites Controls-->
                    <Button Content="Add Test Cases to Suites" Name="btnAddTestCasesToSuites" Margin="25" Width="180" Height="30" Click="btnAddTestCasesToSuites_Click"  Grid.Row="4"  Grid.Column="0" IsEnabled="True"/>
                    <Button Content="Stop" Name="btnStopTestCasesToSuitesAddition" Margin="25" Width="Auto" Height="30" Click="btnStopTestCasesToSuitesAddition_Click"  Grid.Row="4"  Grid.Column="1" IsEnabled="True"/>
                    <StackPanel Orientation="Horizontal" Grid.Row="4"  Grid.Column="2">
                        <Label Content="Retry Json Path" FontWeight="Bold" FontSize="12" Margin="25" />
                        <TextBox Margin="25"  Name="tbTestCasesToSuitesAdditionJsonPath" Height="30" Width="500" Text="{Binding MigrationAddTestCasesToSuitesRetryJsonPath}"/>
                        <Button Name="btnBrowseTestCasesToSuitesJsonPath" Content="Browse" Margin="25" Width="150" Height="30" Click="btnBrowseTestCasesToSuitesJsonPath_Click" />
                    </StackPanel>
                </Grid>

            </ScrollViewer>
        </Grid>
    </Grid>
</UserControl>
